mkdir -p  /opt/docker_work/gitlab_8090/etc
mkdir -p  /opt/docker_work/gitlab_8090/log
mkdir -p  /opt/docker_work/gitlab_8090/data

docker run \
--detach \
--env GITLAB_OMNIBUS_CONFIG="external_url 'http://106.14.58.100:8090/'; gitlab_rails['lfs_enabled'] = true;" \
--publish 8443:443 \
--publish 8090:80 \
--name gitlab_8090 \
--restart unless-stopped \
-v /opt/docker_work/gitlab_8090/etc:/etc/gitlab \
-v /opt/docker_work/gitlab_8090/log:/var/log/gitlab \
-v /opt/docker_work/gitlab_8090/data:/var/opt/gitlab \
gitlab/gitlab-ce:latest

docker run \
--detach \
--publish 8443:443 \
--publish 8090:80 \
--name gitlab_8090 \
--restart unless-stopped \
--hostname 106.14.58.100 \
-v /opt/docker_work/gitlab_8090/etc:/etc/gitlab \
-v /opt/docker_work/gitlab_8090/log:/var/log/gitlab \
-v /opt/docker_work/gitlab_8090/data:/var/opt/gitlab \
--privileged=true  \
gitlab/gitlab-ce:latest


systemctl start docker


docker stop gitlab_8090
docker rm gitlab_8090
rm -rf /opt/docker_work/gitlab_8090

docker logs gitlab_8090



docker run \
--detach \
--publish 8443:443 \    # 映射https端口, 不过本文中没有用到
--publish 8090:80 \      # 映射宿主机8090端口到容器中80端口
--publish 8022:22 \      # 映射22端口, 可不配
--name gitlab_8090 \            
--restart always \
--hostname 106.14.58.100 \    # 局域网宿主机的ip, 如果是公网主机可以写域名
-v /opt/docker_work/gitlab_8090/etc:/etc/gitlab \    # 挂载gitlab的配置文件
-v /opt/docker_work/gitlab_8090/logs:/var/log/gitlab \    # 挂载gitlab的日志文件
-v /opt/docker_work/gitlab_8090/data:/var/opt/gitlab \    # 挂载gitlab的数据
-v /etc/localtime:/etc/localtime:ro \    # 保持宿主机和容器时间同步
--privileged=true beginor/gitlab-ce    # 在容器中能以root身份执行操作


docker run \
--detach \
--publish 8443:443 \    
--publish 8090:80 \      
--publish 8022:22 \      
--name gitlab_8090 \            
--restart always \
--hostname 106.14.58.100 \    
-v /opt/docker_work/gitlab_8090/etc:/etc/gitlab \    
-v /opt/docker_work/gitlab_8090/logs:/var/log/gitlab \    
-v /opt/docker_work/gitlab_8090/data:/var/opt/gitlab \    
-v /etc/localtime:/etc/localtime:ro \    
--privileged=true gitlab/gitlab-ce:latest   